﻿var GetIP = (function (_super) {
    __extends(GetIP, _super);
    function GetIP() {
        return _super !== null && _super.apply(this, arguments) || this;
    }

    GetIP.prototype.execute = function () {
        var commandSettings = this.CommandParam;
        var IpFormula = commandSettings.IpCell;
        var IpFormulaLocation = this.getCellLocation(IpFormula);

        var IpCname = commandSettings.IpCname;
        var IpCnameLocation = this.getCellLocation(IpCname);
        Forguncy.Page.getCellByLocation(IpFormulaLocation).setValue(returnCitySN["cip"]);
        Forguncy.Page.getCellByLocation(IpCnameLocation).setValue(returnCitySN["cname"]);
    }
    return GetIP;
}(Forguncy.CommandBase));

// Key format is "Namespace.ClassName, AssemblyName"

function addScript(url){
    var script = document.createElement("script");
    script.src = "http://pv.sohu.com/cityjson";
    document.head.appendChild(script);
};
addScript();
Forguncy.CommandFactory.registerCommand("GetIP.GetIP, GetIP", GetIP);